package com.liuwei;

import com.liuwei.common.URL;
import com.liuwei.protocol.HttpServer;
import com.liuwei.register.LocalRegister;
import com.liuwei.register.MapRemoteRegister;

import java.io.IOException;

public class Provider {
    static String version = "1.0";
    public static void main(String[] args) throws IOException {
        //先完成本地注册
        LocalRegister.regist(HelloService.class.getName(),version,HelloServiceImpl.class);
        // 注册中心注册,服务注册
        URL url = new URL("localhost",8080);
        MapRemoteRegister.regist(HelloService.class.getName(),url);

        // 要发送网络请求（启动Tomcat服务器）
        HttpServer httpServer = new HttpServer();
        httpServer.start("localhost",8080);
    }

}
